<template>
    <view>
        <!--标题和返回-->
		<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
			<block slot="backText">返回</block>
			<block slot="content">lkd_sys_user</block>
		</cu-custom>
		 <!--表单区域-->
		<view>
			<form>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">手机：</text></view>
                  <input  placeholder="请输入手机" v-model="model.mobile"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">密码：</text></view>
                  <input  placeholder="请输入密码" v-model="model.password"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">登录名：</text></view>
                  <input  placeholder="请输入登录名" v-model="model.username"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">归属公司：</text></view>
                  <input  placeholder="请输入归属公司" v-model="model.companyId"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">归属部门：</text></view>
                  <input  placeholder="请输入归属部门" v-model="model.officeId"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">身份证号：</text></view>
                  <input  placeholder="请输入身份证号" v-model="model.no"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">姓名：</text></view>
                  <input  placeholder="请输入姓名" v-model="model.name"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">性别（字典gender）：</text></view>
                  <input  placeholder="请输入性别（字典gender）" v-model="model.gender"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">出生日期：</text></view>
                  <input  placeholder="请输入出生日期" v-model="model.birthday"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">邮箱：</text></view>
                  <input  placeholder="请输入邮箱" v-model="model.email"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">电话：</text></view>
                  <input  placeholder="请输入电话" v-model="model.phone"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">用户类型:2,用户;3,商户;4,技师;：</text></view>
                  <input  placeholder="请输入用户类型:2,用户;3,商户;4,技师;" v-model="model.userType"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">真人照片：</text></view>
                  <input  placeholder="请输入真人照片" v-model="model.photo"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">最后登陆IP：</text></view>
                  <input  placeholder="请输入最后登陆IP" v-model="model.loginIp"/>
                </view>
              </view>
              <my-date label="最后登陆时间：" v-model="model.loginDate" placeholder="请输入最后登陆时间"></my-date>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">是否可登录：</text></view>
                  <input  placeholder="请输入是否可登录" v-model="model.loginFlag"/>
                </view>
              </view>
              <my-date label="创建时间：" v-model="model.createDate" placeholder="请输入创建时间"></my-date>
              <my-date label="更新时间：" v-model="model.updateDate" placeholder="请输入更新时间"></my-date>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">备注信息：</text></view>
                  <input  placeholder="请输入备注信息" v-model="model.remarks"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">删除标记：</text></view>
                  <input  placeholder="请输入删除标记" v-model="model.delFlag"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">umengToken：</text></view>
                  <input  placeholder="请输入umengToken" v-model="model.umengToken"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">rongcloudToken：</text></view>
                  <input  placeholder="请输入rongcloudToken" v-model="model.rongcloudToken"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">推荐：</text></view>
                  <input type="number" placeholder="请输入推荐" v-model="model.promoted"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">promotedToday：</text></view>
                  <input type="number" placeholder="请输入promotedToday" v-model="model.promotedToday"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">好评推荐：</text></view>
                  <input type="number" placeholder="请输入好评推荐" v-model="model.promotedPoint"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">头像：</text></view>
                  <input  placeholder="请输入头像" v-model="model.avatar"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">realPercent：</text></view>
                  <input type="number" placeholder="请输入realPercent" v-model="model.realPercent"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">昵称：</text></view>
                  <input  placeholder="请输入昵称" v-model="model.nickname"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">身份证_头像：</text></view>
                  <input  placeholder="请输入身份证_头像" v-model="model.idcard1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">身份证_国徽：</text></view>
                  <input  placeholder="请输入身份证_国徽" v-model="model.idcard2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">相册：</text></view>
                  <input  placeholder="请输入相册" v-model="model.album"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">实名状态（0：未认证，1：审核中，2：通过，3：未通过）：</text></view>
                  <input type="number" placeholder="请输入实名状态（0：未认证，1：审核中，2：通过，3：未通过）" v-model="model.realnameStatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">自我介绍：</text></view>
                  <input  placeholder="请输入自我介绍" v-model="model.introduction"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">标签：</text></view>
                  <input  placeholder="请输入标签" v-model="model.tag"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">位置：</text></view>
                  <input  placeholder="请输入位置" v-model="model.position"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">定位名称：</text></view>
                  <input  placeholder="请输入定位名称" v-model="model.positionName"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">职称（字典：job_title）：</text></view>
                  <input  placeholder="请输入职称（字典：job_title）" v-model="model.jobTitle"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">订单数量：</text></view>
                  <input type="number" placeholder="请输入订单数量" v-model="model.orderNumber"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">取消订单数：</text></view>
                  <input type="number" placeholder="请输入取消订单数" v-model="model.cancelNumber"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">归属区域：</text></view>
                  <input  placeholder="请输入归属区域" v-model="model.area"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">余额：</text></view>
                  <input type="number" placeholder="请输入余额" v-model="model.balance"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">新加入商户审核状态（0：尚未审核，1：通过，-1：未通过）：</text></view>
                  <input type="number" placeholder="请输入新加入商户审核状态（0：尚未审核，1：通过，-1：未通过）" v-model="model.newStatus"/>
                </view>
              </view>
              <my-date label="newDate：" v-model="model.newDate" placeholder="请输入newDate"></my-date>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">channel：</text></view>
                  <input  placeholder="请输入channel" v-model="model.channel"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">openid：</text></view>
                  <input  placeholder="请输入openid" v-model="model.openid"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">open2id：</text></view>
                  <input  placeholder="请输入open2id" v-model="model.open2id"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">referrer1：</text></view>
                  <input  placeholder="请输入referrer1" v-model="model.referrer1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">referrer2：</text></view>
                  <input  placeholder="请输入referrer2" v-model="model.referrer2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">服务类型（0:技师上门，1：到店服务，2：两者皆可）：</text></view>
                  <input type="number" placeholder="请输入服务类型（0:技师上门，1：到店服务，2：两者皆可）" v-model="model.serviceType"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">推广余额：</text></view>
                  <input type="number" placeholder="请输入推广余额" v-model="model.shareBalance"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">shareReward：</text></view>
                  <input type="number" placeholder="请输入shareReward" v-model="model.shareReward"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">certificate：</text></view>
                  <input  placeholder="请输入certificate" v-model="model.certificate"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">certificateStatus：</text></view>
                  <input type="number" placeholder="请输入certificateStatus" v-model="model.certificateStatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">certificateStatusRemarks：</text></view>
                  <input  placeholder="请输入certificateStatusRemarks" v-model="model.certificateStatusRemarks"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">video：</text></view>
                  <input  placeholder="请输入video" v-model="model.video"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">videoStatus：</text></view>
                  <input type="number" placeholder="请输入videoStatus" v-model="model.videoStatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">disclaimer：</text></view>
                  <input  placeholder="请输入disclaimer" v-model="model.disclaimer"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">disclaimerStatus：</text></view>
                  <input type="number" placeholder="请输入disclaimerStatus" v-model="model.disclaimerStatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">wx：</text></view>
                  <input  placeholder="请输入wx" v-model="model.wx"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">个人资料审核状态：</text></view>
                  <input type="number" placeholder="请输入个人资料审核状态" v-model="model.infoStatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">orderBalance：</text></view>
                  <input type="number" placeholder="请输入orderBalance" v-model="model.orderBalance"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">blockedBalance：</text></view>
                  <input type="number" placeholder="请输入blockedBalance" v-model="model.blockedBalance"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">orderBalanceAll：</text></view>
                  <input type="number" placeholder="请输入orderBalanceAll" v-model="model.orderBalanceAll"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">pointSum：</text></view>
                  <input type="number" placeholder="请输入pointSum" v-model="model.pointSum"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">pointAvg：</text></view>
                  <input type="number" placeholder="请输入pointAvg" v-model="model.pointAvg"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">realStatus：</text></view>
                  <input type="number" placeholder="请输入realStatus" v-model="model.realStatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">营业状态：1-营业，2-休息：</text></view>
                  <input type="number" placeholder="请输入营业状态：1-营业，2-休息" v-model="model.businessStatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">苹果唯一性ID：</text></view>
                  <input  placeholder="请输入苹果唯一性ID" v-model="model.appleid"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">是否允许登录说明：</text></view>
                  <input  placeholder="请输入是否允许登录说明" v-model="model.loginFlagRemarks"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">工号：</text></view>
                  <input  placeholder="请输入工号" v-model="model.workNo"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">trueOrderNumber：</text></view>
                  <input type="number" placeholder="请输入trueOrderNumber" v-model="model.trueOrderNumber"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">consumeAmount：</text></view>
                  <input type="number" placeholder="请输入consumeAmount" v-model="model.consumeAmount"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">身高：</text></view>
                  <input type="number" placeholder="请输入身高" v-model="model.height"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">体重：</text></view>
                  <input type="number" placeholder="请输入体重" v-model="model.weight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">年龄：</text></view>
                  <input type="number" placeholder="请输入年龄" v-model="model.age"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">工作年限：</text></view>
                  <input type="number" placeholder="请输入工作年限" v-model="model.experience"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">微信openid：</text></view>
                  <input  placeholder="请输入微信openid" v-model="model.wxOpenId"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">微信昵称：</text></view>
                  <input  placeholder="请输入微信昵称" v-model="model.wxNickname"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">微信头像：</text></view>
                  <input  placeholder="请输入微信头像" v-model="model.wxPortrait"/>
                </view>
              </view>
				<view class="padding">
					<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
						<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
					</button>
				</view>
			</form>
		</view>
    </view>
</template>

<script>
    import myDate from '@/components/my-componets/my-date.vue'

    export default {
        name: "LkdSysUserForm",
        components:{ myDate },
        props:{
          formData:{
              type:Object,
              default:()=>{},
              required:false
          }
        },
        data(){
            return {
				CustomBar: this.CustomBar,
				NavBarColor: this.NavBarColor,
				loading:false,
                model: {},
                backRouteName:'index',
                url: {
                  queryById: "/sourceMember/sourceMember/queryById",
                  add: "/sourceMember/sourceMember/add",
                  edit: "/sourceMember/sourceMember/edit",
                },
            }
        },
        created(){
             this.initFormData();
        },
        methods:{
           initFormData(){
               if(this.formData){
                    let dataId = this.formData.dataId;
                    this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
                        if(res.data.success){
                            console.log("表单数据",res);
                            this.model = res.data.result;
                        }
                    })
                }
            },
            onSubmit() {
                let myForm = {...this.model};
                this.loading = true;
                let url = myForm.id?this.url.edit:this.url.add;
				this.$http.post(url,myForm).then(res=>{
				   console.log("res",res)
				   this.loading = false
				   this.$Router.push({name:this.backRouteName})
				}).catch(()=>{
					this.loading = false
				});
            }
        }
    }
</script>
